$thisPath = Split-Path -Parent ($MyInvocation.MyCommand.Definition)
write-host "Please save response database password in each line after ';' in opened txt file." ; if(!(test-path "$thisPath\db_password_list.txt" )){echo "" > "$thisPath\db_password_list.txt" }
notepad "$thisPath\db_password_list.txt"; read-host " "
Foreach( $l in (Get-Content "$thisPath\db_password_list.txt" -ReadCount 0 )){
	$xpath =$l.split(";")[0].trim() ;try{$pwd = $l.split(";")[1].trim()}catch{}
	If( [string]::IsNullOrWhiteSpace($pwd) ){
		write-error "Pwd for $xpath is empty"; continue
	}
    $x = Select-Xml -Path "$thisPath\db_config.xml" -XPath $xpath
	$pwd=$pwd|ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString
	# $x.Node.'#text' = $pwd 
	# check https://stackoverflow.com/questions/10355578/why-is-powershell-telling-me-a-string-is-not-a-string-and-only-when-calling-str
	$x.Node.'#text' = $pwd.psobject.baseobject
	$x.Node.OwnerDocument.Save($x.Path)
}
